var eventHelper = (function () {
    function addEvent(el, type, fn) {
        el.addEventListener ?
                    el.addEventListener(type, fn, false) :
                    (el.attachEvent) ?
                        el.attachEvent('on' + type, fn) :
                        el['on' + type] = fn;
    }
    function removeEvent(el, type, fn) {
        el.removeEventListener ?
                    el.removeEventListener(type, fn, false) :
                    el.detachEvent ?
                        el.detachEvent('on' + type, fn) :
                        el['on' + type] = null;
    }
    function fixEvent(event) {
        if (event) return event;
        event = window.event;
        event.target = event.srcElement;
        event.stopPropagation = stopPropagation;
        event.preventDefault = preventDefault;
        return event;
    }
    function stopPropagation() { this.cancelBubble = true; }
    function preventDefault() { this.returnValue = false; }
    return {
        'addEvent': addEvent,
        'removeEvent': removeEvent,
        'fixEvent': fixEvent
    };
})();
